package ConveyorBelt.Base;

public class Score {
    private static int finalScore = 0;
    private static int currentScore = 0;
    private static long time = 0;
    
    
    public static int getCurrentScore() {
    	return currentScore;
    }

    public static int getFinalScore() {
    	return finalScore;
    }
    public static int getLevelScore() {
		int temp;
		temp = getCurrentScore() + getTempBonus();
		setFinalScore(temp);
		return temp;
    }

    public static void setFinalScore(int score) {
    	Score.finalScore += score;
    }
    
    public static void setCurrentScore(int score) {
    	Score.currentScore += score;
    }
    public static void setDefaultScore() {
    	currentScore = 0;
    }
    
    public static long getTime() {
    	return time;
    }
    
    public static void setTime(long time) {
    	Score.time = time;
    }

    private static int getTempBonus() {
    	int temporalBonus = 0;
    	if (time == 0)  temporalBonus = 0;
		if (time != 0 && time <= 30) temporalBonus = 10000;
		if (time > 30 && time <= 60) temporalBonus = 1000;
		if (time > 60 && time <= 90)  temporalBonus = 100;
		if (time >= 90) temporalBonus = 10;
		return temporalBonus;
    }
}
